<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>菜鸟电子面单</title>
<script type="text/javascript">
	$(function() {
		$("#queryForm").validate();
	});
	function query() {
		$("#queryForm").submit();
	}
</script>
</head>

<body>
	<section class="content">
		<div class="row">
			<div class="col-md-12">
				<!-- Primary box -->
				<div class="box box-solid box-primary">
					<div class="box-header">
						<i class="fa fa-list"></i>
						<h3 class="box-title">查询条件</h3>
						<div class="box-tools pull-right">
							<button class="btn btn-primary btn-sm" data-widget="collapse">
								<i class="fa fa-minus"></i>
							</button>
						</div>
					</div>
					<div class="box-body">
						<form class="form-search" id="queryForm"
							action="${ctx}/v2/logistics/cnInfo" method="post">
							<div class="form-group row">

								<div class="col-sm-3">
									<div class="input-group col-sm-12">
										<label class="input-group-text">快递公司:</label> <select
											class="form-control required" id="companyCode"
											name="companyCode">
											<option value=""></option>
											<c:forEach items="${company}" var="o">
												<option value="${o.companyCode}"
													<c:if test="${param.companyCode eq  o.companyCode}">selected</c:if>>
													${o.companyName}</option>
											</c:forEach>
										</select>
									</div>
								</div>

								<div class="col-sm-3">
									<div class="input-group col-sm-12">
										<button class="btn btn-primary" type="submit">搜索</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

		<div class="form-group row">
			<div class="col-md-12">
				<div class="box box-solid box-primary">
					<div class="box-header">
						<i class="fa fa-list"></i>
						<h3 class="box-title">查询结果</h3>
						<div class="box-tools pull-right">
							<button class="btn btn-primary btn-sm" data-widget="collapse">
								<i class="fa fa-minus"></i>
							</button>
						</div>
					</div>
					<div class="box-body">
						<table id="contentTable"
							class="table table-striped table-bordered table-condensed">
							<thead>
								<tr>
									<th>快递公司</th>
									<th>类型</th>
									<th>地址</th>
									<th>可用数量</th>
									<th>已用数量</th>
									<th>已打印面单总数</th>
									<th>已取消面单总数</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${cnInfos}" var="o">
									<tr>
										<td>${o.cpCode}</td>
										<td>${o.cpType}</td>
										<td>${o.address}</td>
										<td>${o.quantity}</td>
										<td>${o.allocatedQuantity}</td>
										<td>${o.printQuantity}</td>
										<td>${o.cancelQuantity}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</section>

</body>
</html>
